//
//  Mediator.m
//  DesignModel
//
//  Created by 赵明明 on 2022/1/5.
//

#import "Mediator.h"
#import "prod1.h"
#import "prod2.h"
@implementation Mediator
-(Mediator * )myinit{
    if (self==[super init]){
         prod1 * p1;
         [_ma addObject:p1];
         prod2 * p2;
         [_ma addObject:p2];
    }
    return self;
}
-(void)Do:(NSString * )message :(ProdBase *) prod{
    if(![prod isKindOfClass:[prod1 class]]){
        [prod1 getMessage:message];
    }
    if(![prod isKindOfClass:[prod2 class]]){
        [prod2 getMessage:message];
    }
    
}
@end
